<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>限制用户</title>
</head>
<style>
    body{
        background-color: #2c343c;
    }
    #manage{
        position: absolute;
        top: 15%;
        left: 35%;
        width: 300px;
        height: 500px;
        padding: 30px;
        background-color: #fff1eb;
        text-align: center;
    }
    input{
        height: 40px;
        width: 80%;
        border-radius: 2%;
    }
    #limit{
        margin-top: 20px;
        width: 100%;
        height: 100px;
    }
    .no_selected{
        float: left;
        width: 40%;
        height: 100px;
        line-height: 100px;
        margin-left: 20px;
        background-color: #808884;
        color: #fff1eb;
        font-size: 20px;
        text-align: center;
        border-radius: 2%;
    }
    .selected{
        float: left;
        width: 40%;
        height: 100px;
        line-height: 100px;
        margin-left: 20px;
        background-color: #2c343c;
        color: #fff1eb;
        font-size: 20px;
        text-align: center;
        border-radius: 2%;
    }
    #submit{
        color: #fff9ec;
        background-color: rgb(212,25,20);
        width: 80%;
        margin: 20px auto;
        height: 50px;
    }
</style>
<body>
<div id="manage">
    <h2>您的帐号</h2>
    <input placeholder="请输入您的帐号" id="accounts">
    <h2>裁决对象</h2>
    <input placeholder="请输入裁决对象账号，按照邮件中提示" id="accounts1">
    <h2>您的结果</h2>
    <div id="limit">
        <div class="no_selected" id="limit_1" onclick="changeCS()">限制此用户</div>
        <div class="no_selected" id="limit_2" onclick="changeCS2()">不限制此用户</div>
    </div>
    <button id="submit">提交</button>
</div>
<script src="https://cdn.staticfile.org/jquery/2.0.0/jquery.min.js"></script>
<script src="js/GlobalVariable.js"></script>
<script>
     var isLimit = null;
    function changeCS() {
        document.getElementById("limit_1").classList = "selected";
        document.getElementById("limit_2").classList = "no_selected";
        isLimit = true;
    }
    function changeCS2() {
        document.getElementById("limit_2").classList = "selected";
        document.getElementById("limit_1").classList = "no_selected";
        isLimit = false;
    }
//$(document).ready(function(){
    var username = "";
    var Domainname = "http://127.0.0.1:8090/";
    var my_url_id = window.location.search.split('=').pop()-0;
    $("#submit").click(function(){
        username = document.getElementById("accounts").value;
        adjude_obj=document.getElementById("accounts1").value;
        //console.log(isLimit);
        if(adjude_obj==""){
            alert("请输入裁决名！！！");
        }
        if(username==""){
            alert("请输入用户名！！！");
        }
        else if(isLimit == null){
            alert("请选择是否限制用户！！！");
        }
        else{
            $.ajax({
                url: domainname + "arbitration_process",
                type: 'POST',
                dataType: 'json',
                //async: false,
                data: {
                    username: username,
                    arbitration: isLimit,
                    adjude_obj:adjude_obj,
	                get_in_ID: my_url_id
                },
                success: function (data) {
                    console.log(data);
                    alert("提交成功！");
                },
                error: function (data) {
                    alert('error');
                    console.log(data);

                }
            })
        }
    })
	
	
	
//})
</script>

</body>
</html>